package 重要代码;

public class Triangle {
    public static void main(String[] args) {
    Test01(10);
    }
    public static void  Test01(int n){
        int[][] arr=new int[n][];
        for (int i = 0; i <n ; i++) {
       arr[i]=new int[i+1];
        }
        for (int i = 0; i <n ; i++) {
            arr[i][0]=arr[i][i]=1;
            for (int j = 1; j <i ; j++) {
                arr[i][j]=arr[i-1][j]+arr[i-1][j-1];
            }

        }
        for (int i = 0; i <n ; i++) {
            for (int j = 0; j <= i; j++) {
                System.out.print(arr[i][j]+" ");

            }
            System.out.println();
        }

    }
}
